package org.zs.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.zs.dao.UserDaoTx;

@Repository
public class UserDaoTxImpl implements UserDaoTx {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public int updateNameById(String name, Integer id) {
        String sql = "update sys_user set username = ? where id = ?";
        return jdbcTemplate.update(sql, name, id);

    }

    @Override
    public int updateNickNameById(String name, Integer id) {
        String sql = "update sys_user set username = ? where id = ?";
        return jdbcTemplate.update(sql, name, id);
    }
}
